//
//  WBNavigationBar.swift
//  微博
//
//  Created by Jiang on 2019/2/16.
//  Copyright © 2019 Jiang. All rights reserved.
//

import UIKit


///解决iOS 11 下的视图显示问题
class WBNavigationBar: UINavigationBar {

    override func layoutSubviews() {
        super.layoutSubviews()
        
        for subView in self.subviews {
            let stringFromClass = NSStringFromClass(subView.classForCoder)
            print("--------\(stringFromClass)")
            if stringFromClass.contains("BarBackground") {
                subView.frame = self.bounds
                
            }else if stringFromClass.contains("UINavigationBarContentView") {
                subView.frame = CGRect(x: 0, y: 20, width: UIScreen.cz_screenWidth(), height: 44)
            }
            
        }
        
    }

}


